#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    Point(int x = 0,int y = 0)
    : _ix(x)
    , _iy(y)
    {}

    void print() const{
        cout << "(" << _ix
            << "," << _iy
            << ")" << endl;
    }
protected:
    int _ix;
    int getY() const{
        return _iy;
    }
private:
    int _iy;
};

class Point3D
: protected Point
{
public:
    Point3D(int x,int y,int z)
    : Point(x,y)
    , _iz(z)
    {}

    void display() const{//添加了新的成员函数
        print();
        cout << _ix << endl;
        /* cout << _iy << endl; */
        cout << getY() << endl;
        cout << _iz << endl;
    }

private:
    int _iz;//添加新的数据成员
};

class Point4D
: public Point3D
{
public:
    void show() const{
        print();
        getY();
    }
};

void test0(){
    Point3D pt3d1(1,2,3);
    /* pt3d1.print(); */

    /* pt3d1._ix; */
    /* pt3d1.getY(); */
    /* pt3d1._iy; */
}

int main(void){
    test0();
    return 0;
}
